package com.zut.controller.house;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.zut.service.HouseService;
import com.zut.service.impl.HouseServiceImpl;

/**
 * Servlet implementation class deleteHouseServlet
 */
@WebServlet("/deleteHouseServlet")
public class deleteHouseServlet extends HttpServlet {
	HouseService hs = new HouseServiceImpl();
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		int h_id = Integer.parseInt(request.getParameter("h_id"));
		hs.deleteHouse(h_id);
		response.sendRedirect(request.getContextPath()+"/findHouseServlet?currentPage=1");
	}

	
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}
